import service from '@/utils/request'

// @Tags Topic
// @Summary 创建Topic
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Topic true "创建Topic"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /toPic/createTopic [post]
export const createTopic = (data) => {
  return service({
    url: '/toPic/createTopic',
    method: 'post',
    data
  })
}

// @Tags Topic
// @Summary 删除Topic
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Topic true "删除Topic"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /toPic/deleteTopic [delete]
export const deleteTopic = (data) => {
  return service({
    url: '/toPic/deleteTopic',
    method: 'delete',
    data
  })
}

// @Tags Topic
// @Summary 删除Topic
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.IdsReq true "批量删除Topic"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /toPic/deleteTopic [delete]
export const deleteTopicByIds = (data) => {
  return service({
    url: '/toPic/deleteTopicByIds',
    method: 'delete',
    data
  })
}

// @Tags Topic
// @Summary 更新Topic
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Topic true "更新Topic"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Router /toPic/updateTopic [put]
export const updateTopic = (data) => {
  return service({
    url: '/toPic/updateTopic',
    method: 'put',
    data
  })
}

// @Tags Topic
// @Summary 用id查询Topic
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query model.Topic true "用id查询Topic"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /toPic/findTopic [get]
export const findTopic = (params) => {
  return service({
    url: '/toPic/findTopic',
    method: 'get',
    params
  })
}

// @Tags Topic
// @Summary 分页获取Topic列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query request.PageInfo true "分页获取Topic列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /toPic/getTopicList [get]
export const getTopicList = (params) => {
  return service({
    url: '/toPic/getTopicList',
    method: 'get',
    params
  })
}
